SUBDIRS = .

SUFFIXES=.def .opn .dat

.dat.opn: ../sm2c_temp
	LD_LIBRARY_PATH=..:$(LD_LIBRARY_PATH) ../sm2c_temp $<
.dat.def: ../sm2c_temp
	LD_LIBRARY_PATH=..:$(LD_LIBRARY_PATH) ../sm2c_temp $<

sm_progs = smcreate smdata smproj smedit smsort smgrep smfind

EXTRA_DIST = $(sm_progs:%=%.dat)
BUILT_SOURCES = $(sm_progs:%=%.def)

bin_PROGRAMS = $(sm_progs) sm2c sm2awk smquick smupdate smclean smdisp pcurse

AM_CFLAGS = -I.. -DSM_SYSV
AM_LDFLAGS = -L.. -lscrmgr -lmylib -lncurses

sm2c_SOURCES = sm2c.c
smcreate_SOURCES = smcreate.c
smdata_SOURCES = smdata.c
smquick_SOURCES = smquick.c
sm2awk_SOURCES = sm2awk.c
smupdate_SOURCES = smupdate.c
smproj_SOURCES = smproj.c
smclean_SOURCES = smclean.c
smedit_SOURCES = smedit.c
smsort_SOURCES = smsort.c
smgrep_SOURCES = smgrep.c
smfind_SOURCES = smfind.c

smdisp_SOURCES = smdisp.c
smdisp_CFLAGS = -I.. -DSM_SYSV
smdisp_LDFLAGS = -lncurses

pcurse_SOURCES = pcurse.c
pcurse_CFLAGS = -I.. -DSM_SYSV
pcurse_LDFLAGS = -lncurses
